import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/database/beans/get_all_goods_entity.dart';
import 'package:flutter_deer/database/beans/get_all_goods_list.dart';

import 'package:flutter_deer/database/tables.dart';


GetAllGoodsEntity $GetAllGoodsEntityFromJson(Map<String, dynamic> json) {
  final GetAllGoodsEntity getAllGoodsEntity = GetAllGoodsEntity();
  final List<GetAllGoodsList>? list = (json['list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GetAllGoodsList>(e) as GetAllGoodsList).toList();
  if (list != null) {
    getAllGoodsEntity.list = list;
  }
  final String? total = jsonConvert.convert<String>(json['total']);
  if (total != null) {
    getAllGoodsEntity.total = total;
  }
  return getAllGoodsEntity;
}

Map<String, dynamic> $GetAllGoodsEntityToJson(GetAllGoodsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  data['total'] = entity.total;
  return data;
}

extension GetAllGoodsEntityExtension on GetAllGoodsEntity {
  GetAllGoodsEntity copyWith({
    List<GetAllGoodsList>? list,
    String? total,
  }) {
    return GetAllGoodsEntity()
      ..list = list ?? this.list
      ..total = total ?? this.total;
  }
}